<%@page import="ebedynky.services.MyUserDetailService"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<div id ="header2">
    <ul id="nav" class="dropdown dropdown-horizontal">
        <li><a href="/">Home</a></li>
        <li><span class="dir">About Us</span>
            <ul>
                <li><a href="/">History</a></li>

                <li><a href="/">Our Vision</a></li>
                <li><span class="dir">The Team</span>
                    <ul>
                        <li><a href="/">Cernil Milan</a></li>
                        <li><a href="/">David Ondrej</a></li>
                        <li><a href="/">Remes Jan</a></li>
                        <li><a href="/">Barbariyskiy Nikolay</a></li>
                    </ul>
                </li>

                <li><a href="/">Press</a></li>
                <li><a href="/">FAQs</a></li>
            </ul>
        </li>

        <sec:authorize access="hasRole('ROLE_SUPLIER')"  >
            <li><span class="dir">Offer</span>
                <ul>
                    <li><a href="/offerAdd">Create offer</a></li>
                    <li><a href="/offerDel">Delete offer</a></li>
                    <li><a href="/offerSel">Modify offer</a></li>
                    <li><span class="dir">Item</span>
                        <ul>
                            <li><a href="/offerItemAdd">Add Offer Item</a></li>
                            <li><a href="/offerItemDel">Delete Offer Item</a></li>
                        </ul>
                    </li>
                    <li><span class="dir">Place</span>
                        <ul>
                            <li><a href="/deliveryPlaceAdd">Add Delivery Place</a></li>
                            <li><a href="/deliveryPlaceDel">Delete Delivery Place</a></li>
                        </ul>
                    </li>
                    <li><span class="dir">Box</span>
                        <ul>
                            <li><a href="/boxAdd">Add Box</a></li>
                            <li><a href="/boxDel">Delete Box</a></li>
                        </ul>
                    </li>
                    <li><a href="/">View all offers</a></li>
                    <li><a href="/">Compound box</a></li>
                </ul>
            </li>
        </sec:authorize>
        <sec:authorize access="hasRole('ROLE_CUSTOMER')"  >
            <li><span class="dir">Order</span>
                <ul>
                    <li><a href="/orderAdd">Create order</a></li>
                    <li><a href="/orderDel">Delete order</a></li>
                    <li><a href="/orderSel">Modify order</a></li>
                    <li><span class="dir">Item</span>
                        <ul>
                            <li><a href="/orderItemAdd">Add Order Item</a></li>
                            <li><a href="/orderItemDel">Delete Order Item</a></li>
                        </ul>
                    </li>
                </ul>
            </li>
        </sec:authorize>
        <sec:authorize access="hasRole('ROLE_USER')"  >
            <li><span class="dir">Grange</span>
                <ul>
                    <li><a href="/grange">Create grange</a></li>
                    <li><a href="/">Delete grange</a></li>
                    <li><a href="/">Find grange</a></li>
                </ul>
            </li>
        </sec:authorize>
        <sec:authorize access="hasRole('ROLE_SUPLIER')"  >
            <li><span class="dir">Product</span>
                <ul>
                    <li><a href="/productAdd">Add Product</a></li>
                    <li><a href="/productDel">Delete Product</a></li>
                    <li><span class="dir">Category</span>
                        <ul>
                            <li><a href="/productCategoryAdd">Add Product Category</a></li>
                            <li><a href="/productCategoryDel">Delete Product Category</a></li>
                        </ul>
                    </li>
                    <li><span class="dir">Genus</span>
                        <ul>
                            <li><a href="/productGenusAdd">Add Product Genus</a></li>
                            <li><a href="/productGenusDel">Delete Product Genus</a></li>
                        </ul>
                    </li>
                    <li><span class="dir">Specification</span>
                        <ul>
                            <li><a href="/productSpecificationAdd">Add Product Specification </a></li>
                            <li><a href="/productSpecificationDel">Delete Product Specification</a></li>
                        </ul>
                    </li>
                </ul>
            </li>
        </sec:authorize>
        <sec:authorize access="isAuthenticated()"  >
            <li><span class="dir">Message</span>
                <ul>
                    <li><a href="/">Send message</a></li>
                    <li><a href="/">View message</a></li>
                </ul>
            </li>
        </sec:authorize>
        <sec:authorize access="hasRole('ROLE_ADMIN')"  >
            <li><span class="dir">User</span>
                <ul>
                    <li><a href="/">Manage profile</a></li>
                    <li><a href="/FindUser">Find user</a></li>
                    <li><a href="/Allusers">All users</a></li>
                    <li><a href="/Allusers">Delete user</a></li>
                </ul>
            </li>
        </sec:authorize>
        <sec:authorize access="hasRole('ROLE_ADMIN')"  >
            <li><a href="/admin">Admin zone</a></li>
        </sec:authorize>
    </ul>
</div>
<div id="header">
</div>
<div id="header_t">
    <ul>
        <sec:authorize access="!isAuthenticated()"  >
            <li class="reg">|<a href="/login">sign in</a>|</li>
            <li class="reg">|<a href="/user">register</a>|</li>
        </sec:authorize>
        <sec:authorize access="isAuthenticated()">
            <li class="reg">Logged in as: <strong><c:out value="<%=MyUserDetailService.getLoggedUsernameWithRoles()%>"/></strong></li>
            <!--<sec:authentication property="principal.username"/>-->
            <li class="reg">|<a href="<c:url value="/j_spring_security_logout"/>">logout</a>|</li>
        </sec:authorize>
    </ul>
</div>